/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.product;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.psi.mapper.product.ProductOwnMapper;
public class ProductOwnAction extends BaseAction
{
    @Autowired(required=false)
	private ProductOwnMapper mapper;
    /**
    自制件统计图
    */
    
    public Map cartogramMadeMy() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> classid=mapper.classid(params);
        result.put("classid", classid);
        
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        
        
        result.putAll(super.listDepartments());
        
        
        SQLList<SQLMap> all=mapper.all(params);
        result.put("all", all);
        
        
        tb = createTreeBean("l_class_treecols");
        tb.setPid(2);
        SQLList<SQLMap> l_class=mapper.l_class(params);
        l_class = l_class.buildTree(tb,tb.getPid());
        result.put("l_class", l_class);
        
        return result;
    }
    /**
    */
    
    public Object produce() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> p_produce=mapper.p_produce(params,pagination);
        p_produce.setPagedListInfo(pagination);
        result.put("p_produce", p_produce);
        
        return p_produce;
    }
    /**
    饼状统计图
    */
    
    public Map manufacturedChart() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        SQLList<SQLMap> s_c=mapper.s_c(params);
        result.put("s_c", s_c);
        
        return result;
    }
    /**
    自制件增加
    */
    
    public Map productOwnAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> list_produuctype=mapper.list_produuctype(params);
        result.put("list_produuctype", list_produuctype);
        
        
        result.put("product_info", create_code(getParameter("CMID5"),"product_barcode"));
        
        
        tb = createTreeBean("l_class_treecols");
        tb.setPid(2);
        SQLList<SQLMap> l_class=mapper.l_class(params);
        l_class = l_class.buildTree(tb,tb.getPid());
        result.put("l_class", l_class);
        
        
        SQLList<SQLMap> s_produce_series=mapper.s_produce_series(params);
        result.put("s_produce_series", s_produce_series);
        
        return result;
    }
    /**
    自制件明细
    */
    
    public Map productOwnDets() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> produce=mapper.produce(params);
        SQLMap produce_emt=produce.getExistfirst();
        result.put("produce", produce_emt);
        
        
        SQLList<SQLMap> list_produuctype=mapper.list_produuctype(params);
        result.put("list_produuctype", list_produuctype);
        
        
        
        return result;
    }
    /**
    自制件修改
    */
    
    public Map productOwnUpdate() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("l_class_treecols");
        tb.setPid(2);
        SQLList<SQLMap> l_class=mapper.l_class(params);
        l_class = l_class.buildTree(tb,tb.getPid());
        result.put("l_class", l_class);
        
        
        SQLList<SQLMap> produce=mapper.produce(params);
        SQLMap produce_emt=produce.getExistfirst();
        result.put("produce", produce_emt);
        
        
        SQLList<SQLMap> list_produuctype=mapper.list_produuctype(params);
        result.put("list_produuctype", list_produuctype);
        
        return result;
    }
    /**
    分类列表
    */
    
    public Map productOwnClassList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> class_list=mapper.class_list(params,pagination);
        class_list.setPagedListInfo(pagination);
        result.put("class_list", class_list);
        
        return result;
    }
    /**
    自制件搜索
    */
    
    public Map productOwnSearchs() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("l_class_treecols");
        tb.setPid(2);
        SQLList<SQLMap> l_class=mapper.l_class(params);
        l_class = l_class.buildTree(tb,tb.getPid());
        result.put("l_class", l_class);
        
        
        result.put("s_search", pagination.getSearchParas());
        
        
        
        return result;
    }
    /**
    产品列表
    */
    
    public Map productOwnSearchList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> p_list=mapper.p_list(params,pagination);
        p_list.setPagedListInfo(pagination);
        result.put("p_list", p_list);
        
        return result;
    }
    /**
    修改分类名
    */
    
    public Map productOwnClassNmatUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_product_class=mapper.s_product_class(params);
        SQLMap s_product_class_emt=s_product_class.getExistfirst();
        result.put("s_product_class", s_product_class_emt);
        
        return result;
    }
    /**
    转移分类
    */
    
    public Map productOwnTransferClass() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_class=mapper.s_class(params);
        result.put("s_class", s_class);
        
        return result;
    }
    /**
    自制件列表
    */
    
    public Map productOwnList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> product_list=mapper.product_list(params);
        result.put("product_list", product_list);
        
        return result;
    }
    /**
    */
    
    public Map u_pc() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.u_pc(params);
        
        return result;
    }
    /**
    */
    
    public Map d_pi() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_pi(params);
        
        return result;
    }
    /**
    自制件增加修改
    */
    
    public Map productOwnAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMID = mapper.CMID(params);
        result.put("CMID", CMID);
        
        
        int i_pack = mapper.i_pack(params);
        result.put("i_pack", i_pack);
        
        return result;
    }
    /**
    自制件修改修改
    */
    
    public Map productOwnUpdateSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int u_info = mapper.u_info(params);
        result.put("u_info", u_info);
        
        return result;
    }
    /**
    新分类修改
    */
    
    public Map productOwnNewClassSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int newid = mapper.newid(params);
        result.put("newid", newid);
        
        return result;
    }
    /**
    */
    
    public Map u_pi() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.u_pi(params);
        
        return result;
    }
    /**
    修改分类名修改
    */
    
    public Map productOwnClassNmatUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int u_class = mapper.u_class(params);
        result.put("u_class", u_class);
        
        return result;
    }
    /**
    转移分类修改
    */
    
    public Map productOwnTransferClassSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int u_class = mapper.u_class(params);
        result.put("u_class", u_class);
        
        return result;
    }
}